package Morning;

import java.util.Iterator;
import java.util.LinkedHashSet;

public class Hash_set02 {

    public static void main(String[] args) {

        LinkedHashSet<Student> res = new LinkedHashSet<>();

          res.add(new Student("张三",19,"男"));
          res.add(new Student("张三",21,"男"));
          res.add(new Student("李四",21,"男"));
          res.add(new Student("王二",23,"女"));
          res.add(new Student("赵钱",22,"男"));
          res.add(new Student("孙李",20,"女"));


        Iterator<Student> iterator = res.iterator();



        while (iterator.hasNext()){

            System.out.println(iterator.next());
        }
    }
}
